﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLuaBase.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class WorldMapBaseLuaLODLayerWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(WorldMapBase.LuaLODLayer);
			Utils.BeginObjectRegister(type, L, translator, 0, 2, 0, 0);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnLODLevelChange", _m_OnLODLevelChange);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnNextLODPercentUpdate", _m_OnNextLODPercentUpdate);
			
			
			
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 1, 5, 5);
			
			
            
			Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "FunctionName_OnLODLevelChange", _g_get_FunctionName_OnLODLevelChange);
            Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "FunctionName_OnNextLODPercentUpdate", _g_get_FunctionName_OnNextLODPercentUpdate);
            Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "FunctionName_OnCreate", _g_get_FunctionName_OnCreate);
            Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "FunctionName_OnDestroy", _g_get_FunctionName_OnDestroy);
            Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "FunctionName_OnUpdateViewRect", _g_get_FunctionName_OnUpdateViewRect);
            
			Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "FunctionName_OnLODLevelChange", _s_set_FunctionName_OnLODLevelChange);
            Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "FunctionName_OnNextLODPercentUpdate", _s_set_FunctionName_OnNextLODPercentUpdate);
            Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "FunctionName_OnCreate", _s_set_FunctionName_OnCreate);
            Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "FunctionName_OnDestroy", _s_set_FunctionName_OnDestroy);
            Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "FunctionName_OnUpdateViewRect", _s_set_FunctionName_OnUpdateViewRect);
            
			
            Utils.RegisterFunc(L, Utils.CLS_IDX, "New", __CreateInstanceNew);
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TTABLE))
				{
					XLua.LuaTable _luaTable = (XLua.LuaTable)translator.GetObject(L, 2, typeof(XLua.LuaTable));
					
					var gen_ret = new WorldMapBase.LuaLODLayer(_luaTable);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to WorldMapBase.LuaLODLayer constructor!");
            
        }

        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstanceNew(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TTABLE))
				{
					XLua.LuaTable _luaTable = (XLua.LuaTable)translator.GetObject(L, 1, typeof(XLua.LuaTable));
					
					var gen_ret = new WorldMapBase.LuaLODLayer(_luaTable);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to WorldMapBase.LuaLODLayer constructor!");
            
        }

        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_OnLODLevelChange(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                WorldMapBase.LuaLODLayer gen_to_be_invoked = (WorldMapBase.LuaLODLayer)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    int _currentLodLevel = LuaAPI.xlua_tointeger(L, 2);
                    int _lastLodLevel = LuaAPI.xlua_tointeger(L, 3);
                    
                    gen_to_be_invoked.OnLODLevelChange( _currentLodLevel, _lastLodLevel );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_OnNextLODPercentUpdate(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                WorldMapBase.LuaLODLayer gen_to_be_invoked = (WorldMapBase.LuaLODLayer)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    int _lodLevel = LuaAPI.xlua_tointeger(L, 2);
                    float _nextLevelPercent = (float)LuaAPI.lua_tonumber(L, 3);
                    
                    gen_to_be_invoked.OnNextLODPercentUpdate( _lodLevel, _nextLevelPercent );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_FunctionName_OnLODLevelChange(RealStatePtr L)
        {
		    try {
            
			    LuaAPI.lua_pushstring(L, WorldMapBase.LuaLODLayer.FunctionName_OnLODLevelChange);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_FunctionName_OnNextLODPercentUpdate(RealStatePtr L)
        {
		    try {
            
			    LuaAPI.lua_pushstring(L, WorldMapBase.LuaLODLayer.FunctionName_OnNextLODPercentUpdate);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_FunctionName_OnCreate(RealStatePtr L)
        {
		    try {
            
			    LuaAPI.lua_pushstring(L, WorldMapBase.LuaLODLayer.FunctionName_OnCreate);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_FunctionName_OnDestroy(RealStatePtr L)
        {
		    try {
            
			    LuaAPI.lua_pushstring(L, WorldMapBase.LuaLODLayer.FunctionName_OnDestroy);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_FunctionName_OnUpdateViewRect(RealStatePtr L)
        {
		    try {
            
			    LuaAPI.lua_pushstring(L, WorldMapBase.LuaLODLayer.FunctionName_OnUpdateViewRect);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_FunctionName_OnLODLevelChange(RealStatePtr L)
        {
		    try {
                
			    WorldMapBase.LuaLODLayer.FunctionName_OnLODLevelChange = LuaAPI.lua_tostring(L, 1);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_FunctionName_OnNextLODPercentUpdate(RealStatePtr L)
        {
		    try {
                
			    WorldMapBase.LuaLODLayer.FunctionName_OnNextLODPercentUpdate = LuaAPI.lua_tostring(L, 1);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_FunctionName_OnCreate(RealStatePtr L)
        {
		    try {
                
			    WorldMapBase.LuaLODLayer.FunctionName_OnCreate = LuaAPI.lua_tostring(L, 1);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_FunctionName_OnDestroy(RealStatePtr L)
        {
		    try {
                
			    WorldMapBase.LuaLODLayer.FunctionName_OnDestroy = LuaAPI.lua_tostring(L, 1);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_FunctionName_OnUpdateViewRect(RealStatePtr L)
        {
		    try {
                
			    WorldMapBase.LuaLODLayer.FunctionName_OnUpdateViewRect = LuaAPI.lua_tostring(L, 1);
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
		
		
		
		
    }
}
